Edit AUTOEXEC.BATAUTOEXEC.BAT is a special-purpose batch file containing commands that are automatically executed by MS-DOS whenever the computer is turned on or rebooted in an MS-DOS configuration. EDIT/CHANGE AUTOEXEC.BAT file, using one of the following procedure sets, depending on the current environment: 1) Edit AUTOEXEC.BAT from MS-DOS: a) Enter the following commands at the DOS prompt: COPY C:\AUTOEXEC.BAT C:\AUTOEXEC.OLD EDIT C:\AUTOEXEC.BAT b) Use the arrow keys to move to the line(s) to be changed. c) Add new command lines or edit existing lines. d) Review all changes, checking for correct spelling (for example, commands, directories, filenames) and command syntax. e) Enter the following keystrokes to save the file: 1] Press ALT+F (file menu). 2] Press X (exit). 3] Press ENTER (save file and exit editor). f) Press CTRL+ALT+DEL to reboot the computer for the changes to take effect. 2) Edit AUTOEXEC.BAT from MICROSOFT WINDOWS: a) Select 'Program Manager'. b) Open 'Notepad' in 'Accessories'. c) Select the 'File' menu and select 'Open'. d) Enter the following in the 'Filename' box. C:\AUTOEXEC.BAT e) Select the 'File' menu and select 'Save as...'. f) Enter the following in the 'Filename' box. C:\AUTOEXEC.OLD g) Use the arrow keys to move to the line(s) to be changed. h) Add new command lines or edit existing lines. i) Review all changes, checking for correct spelling (e.g., commands, directories, filenames) and command syntax. j) Select 'Save as...' under 'File'. k) Enter the following in 'Filename' box. C:\AUTOEXEC.BAT l) Select the 'File' menu and select 'Exit'. m) In Program Manager, select the 'File' menu and select 'Exit Windows'. n) Press CTRL+ALT+DEL at the DOS prompt to reboot the computer for changes to take effect. 3) Edit AUTOEXEC.BAT from OS/2: NOTE: With a Dual Boot configuration, there are two AUTOEXEC.BAT files: one for DOS (usually called AUTOEXEC.DOS when OS/2 is running) and one for OS/2 DOS sessions run under OS/2. Ensure that the correct AUTOEXEC.BAT file is edited under OS/2. a) Open an OS/2 Window and enter the following commands at the OS/2 prompt: COPY C:\AUTOEXEC.BAT AUTOEXEC.OLD E C:\AUTOEXEC.BAT b) Use the arrow keys to move to the line(s) to be changed. c) Make changes and/or additions (see SAMPLE below). d) Review all changes, checking for correct spelling (for example, commands, directories, filenames) and command syntax. e) Save the file as follows: 1] Select 'File'. 2] Select 'Save'. 3] Select 'Type'. 4] Choose 'DOS Command File'. 5] Choose 'Set'. 6] Double-click on upper-left corner of window to close editor. f) Open a DOS window or reboot into DOS for changes to take effect. 4) If unable to save/overwrite AUTOEXEC.BAT, exit without saving changes and change the file attributes on AUTOEXEC.BAT. Then re-edit file, make changes, save as AUTOEXEC.BAT and exit editor. a) Enter the following command at the DOS prompt: ATTRIB -x AUTOEXEC.BAT (where x is the attribute to be removed). b) EXAMPLES: 1] To remove Read-only attribute enter the following command: ATTRIB -R AUTOEXEC.BAT 2] To remove Hidden attribute enter the following command: ATTRIB -H AUTOEXEC.BAT 5) Watch the boot process to make sure the changes are working properly. 6) If problems are encountered, try one or more of the following at the DOS prompt, to diagnose and repair problem: a) Place REM in front of @ECHO OFF statement to show every command on display while troubleshooting problems. b) Place REM in front of auxiliary commands while troubleshooting critical commands. c) (Optional) Press CTRL+S to pause execution to view error messages on screen. Then press any key to continue execution. d) (Optional) Press F5 as soon as 'Starting MS-DOS...' appears on display to completely by-pass both the CONFIG.SYS and AUTOEXEC.BAT files. e) (Optional) Press F8 as soon as 'Starting MS-DOS...' appears on display to pause execution and step through each command in CONFIG.SYS AND AUTOEXEC.BAT one at a time. Watch for errors and repair offending commands. f) (Optional) Run MemMaker at DOS prompt (although not under OS/2) to optimize AUTOEXEC.BAT and CONFIG.SYS to free more conventional memory. 7) Save corrected copy of AUTOEXEC.BAT to an alternate directory and the System Recovery Diskette. 8) If unable to correct problem or improve operation, enter the following command at the DOS or OS/2 prompt to return to the original AUTOEXEC.BAT: COPY AUTOEXEC.OLD AUTOEXEC.BAT SAMPLE AUTOEXEC.BAT NOTE: Lines are numbered in this example only for easy reference in explanation below. DO NOT number lines in an actual AUTOEXEC.BAT file. WARNING: Do not attempt to use this entire sample AUTOEXEC.BAT. Some sample lines (included for illustration purposes) may conflict with each other and cause problems on the computer. 1 @ECHO OFF 2 C:\QEMM\LOADHI /R:1 /RES=28400 /SQT=D800-DBFF C:\WINDOWS\SMARTDRV.EXE /L 3 PROMPT=$p$g 4 PATH C:\;C:\DOS;C:\WINDOWS;C:\EXCEL; 5 MSCDEX /D:MSCD001 /L:G /D:MSCD000 /L:H 6 SET TMP=C:7 SET COMSPEC=C:\DOS\COMMAND.COM 8 LOADHIGH DOSKEY FINDFILE=DIR /A /S /B $* 9 SET TEMP=C:\WIN\TEMP 10 MODE COM1:=LPT1: 11 WIN LINE BY LINE EXPLANATION 1 Turns off the console (display) while executing the remaining commands in this file. 2 Loads SMARTDrive into upper memory, under the control of the QEMM memory driver. 3 Sets the DOS prompt to show the current drive and current directory path. 4 Path statement tells DOS to look in these listed directories for files not in current directory. 5 Assigns CD-ROM device 001 to Drive G and CD-ROM device 000 to Drive H. (See related device drivers in CONFIG.SYS) 6 Creates the environment variable TMP and sets it to store temporary files in the C:\ directory. 7 Sets an environment variable (COMSPEC) to define the location of COMMAND.COM to use. 8 Loads the TSR DOSKEY (retrieves last few DOS commands) into high memory. Also loads the FINDFILE command into high memory. 9 Creates the environment variable TEMP, and sets it to store temporary files for Windows in the C:\WINDOWS\TEMP directory. 10 Redirects all output for the parallel port LPT1 to the serial port COM1. 11 Loads Microsoft Windows. TIPS 1) To make temporary changes, place REM (remarks command) at the beginning of each command line to be changed. Then try booting with this configuration. Or, copy lines to be changed and change the copies. This preserves the original configuration of the command line in case changes do not work properly. 2) Make sure a semicolon follows each path component in the PATH= command line. 3) Make sure the backslash (\) is used in path statements (not forward slash (/)). 4) Editing the AUTOEXEC.BAT file to change more than a few lines is a risky and complicated process. Get a good MS-DOS reference book that gives detailed descriptions of what each line in the AUTOEXEC.BAT file does, and examples of how the lines should look with various computer configurations. Subject to the terms set forth in the end-user license agreement. All rights reserved. |